/**
 * 
 */
package org.vsg.stock.bulk.io;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;

import org.vsg.common.biz.exception.ServiceException;

/**
 * @author 80191661
 *
 */
public interface PostgreSQLDataImport {
	
	
	void connect();
	
	void disconnect();
	
	/**
	 * define import data & handle
	 * @param tableName
	 * @param file
	 * @return
	 */
	boolean importData(String tableName , File file) throws ServiceException , IOException;
	
	/**
	 * define import data & handle with fiels
	 * @param tableName
	 * @param file
	 * @param fields
	 * @return
	 * @throws ServiceException
	 * @throws IOException
	 */
	boolean importData(String tableName , File file , String[] fields) throws ServiceException , IOException;
	
	/**
	 * 
	 * @param tableName
	 * @param is
	 * @param fields
	 * @return
	 * @throws ServiceException
	 * @throws IOException
	 */
	boolean importData(String tableName , InputStream is , String[] fields) throws ServiceException , IOException;

	
	/**
	 * 
	 * @param tableName
	 * @param is
	 * @param fields
	 * @return
	 * @throws ServiceException
	 * @throws IOException
	 */
	boolean importData(String tableName , InputStream is , String[] fields , Map<String , String> opts) throws ServiceException , IOException;
	
}
